home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / CopyBits Demo 1.5 / CopyBits Demo 1.5 ReadMe < prev    next >
Text File  |  1995-05-18  |  3KB  |  33 lines

  1. CopyBits Demo 1.0 ReadMe
  2.  
  3. Requires System 7 or later.
  4.  
  5. CopyBits Demo is an example project that gives several examples of using CopyBits to copy pictures both on screen and between offscreen Graphics Worlds and an onscreen window (as well as between GWorlds). It also shows how to use CopyBits to accomplish a "fade to black" on a specific area of the screen (rather than the whole monitor). Wait! There's more! It also demonstrates the difference between "flickering" regular animation and smooth animation using GWorlds (and demonstrates how to do it). And, with version 1.5, it does an image to image fade using CopyBits! All the code and the project file to build the demo app is included (Metrowerks CodeWarrior C).
  6.  
  7. The main dialog of the application shows two "source" pictures and a destination area. Clicking on the buttons uses CopyBits to copy images and do a halfway decent fade-to-black using CopyBits. This is the only practical way I know of to fade only part of the screen anywhere close to smoothly. The app demonstrates how using an offscreen GWorld can make animation flicker free by "floating" a colored circle over each of the two "source" pictures when the cursor is over them. Picture 1 (on the left) uses conventional animation. It repeatedly draws the picture to the screen and then draws the circle over it. This results in the background picture occasionally "flickering" through so that it can be seen through the circle. This is even more noticeable with larger pictures. Picture 2 (on the right) uses an offscreen GWorld as an intermediate step. The background picture is drawn to the GWorld, then the colored circle is drawn over the picture in the GWorld, then the contents of the GWorld are copied to the screen. This results in flicker-free animation where the background picture can _never_ be seen through the circle.
  8.  
  9. By the way, using GWorlds does NOT require Color QuickDraw, just System 7 or later. As a result, this app requires System 7 or later to run.
  10.  
  11. This project was written by Kenneth Worley in the hopes of helping other programmers. If you have any questions, concerns, criticisms, bug reports, etc., please e-mail me at KNEworley@aol.com. The project is ©1995. All Rights Reserved.
  12.  
  13. Feel free to distribute this project (with all of its accompanying files) freely to anyone or upload it to other BBSs or online services. Please obtain my permission before including the project in a disk or CD for sale. Thanks!
  14.  
  15. Notes:
  16.  
  17. Only works well at 256 colors (not tested at higher bit depths).
  18. Works fine with grays instead of colors.
  19. Haven't implemented fading between pictures. That'll come in the next version.
  20.  
  21. 950516
  22.  
  23. Updated to handle "bad disk" insertions properly.
  24. Updated to handle update events in the main dialog by redrawing squares around picture areas.
  25.  
  26. 950518
  27.  
  28. Updated to version 1.5
  29. Fading between images added.
  30. Code cleaned up.
  31. Speed range changed from 1-100 to 0-20.
  32. Changed PICTs (that's right! I used to be a cop!).
  33.